package com.example.uilearning;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ArrayAdapterActivity extends Activity {
	private ListView listView1, listView2;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_array_adapter);
		listView1 = (ListView) findViewById(R.id.list1);
		listView2 = (ListView) findViewById(R.id.list2);
		// 定义第一个要展示的数组
		String[] arr1 = new String[] { "艾弗森", "詹姆斯", "韦德", "安东尼" };
		String[] arr2 = new String[] { "篮球", "足球", "网球", "羽毛球" };
		ArrayAdapter<String> adaptor1 = new ArrayAdapter<String>(this,
				R.layout.array_item, arr1);
		ArrayAdapter<String> adaptor2 = new ArrayAdapter<String>(this,
				R.layout.array_item, arr2);
		listView1.setAdapter(adaptor1);
		listView2.setAdapter(adaptor2);
	}
}
